<?php

/**
 * Ignus Framework
 *
 * @author Sergey Palyanov <sergey.palyanov@gmail.com>
 * @link http://code.google.com/p/ignus-php/
 * @license http://apache.org/licenses/LICENSE-2.0
 * @package Ignus
 * @subpackage Test
 * @since 0.1
 */

namespace Ignus\Test\Report;

use Ignus\Test\AssertionException;

/**
 * @package Ignus
 * @subpackage Test
 * @since 0.5
 */
class HtmlReporter implements Reporter
{
    public function printHeader($caseName)
    {
        echo '<table><tr><th>Test</th><th>Result</th></tr>';
    }

    public function printTestSuccess($testName)
    {
        echo '<tr><td>', $testName, '</td><td><span style="color: #0f0;">OK</span></td></tr>';
    }

    public function printTestFailure($testName, AssertionException $e)
    {
        echo '<tr><td>', $testName, '</td><td><span style="color: #f00;">FAILURE</span></td></tr>';
    }

    public function printTotals()
    {

    }

    public function printFooter()
    {
        echo '</table>';
    }

    public function printUnexpectedException($testName, \Exception $e)
    {
        echo '<tr><td>', $testName, '</td><td><span style="color: #f00;">EXCEPTION', $e, '</span></td></tr>';
    }
}
